home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / dev / obero / Interfaces3_4.lha / Interfaces / CardRes.mod < prev    next >
Text File  |  1994-03-05  |  6KB  |  181 lines

  1. (*
  2. (*  Amiga Oberon Interface Module:
  3. **  $VER: CardRes.mod 40.15 (28.12.93) Oberon 3.0
  4. **
  5. **      (C) Copyright 1991-1992 Commodore-Amiga, Inc.
  6. **          All Rights Reserved
  7. **
  8. **      (C) Copyright Oberon Interface 1993 by hartmut Goebel
  9. *)          All Rights Reserved
  10. *)
  11.  
  12. MODULE CardRes;
  13.  
  14. IMPORT e * := Exec, SYSTEM *;
  15.  
  16. CONST
  17.   cardResName    * = "card.resource";
  18.  
  19. TYPE
  20.   CardHandlePtr    * = UNTRACED POINTER TO CardHandle;
  21.   DeviceTDataPtr   * = UNTRACED POINTER TO DeviceTData;
  22.   CardMemoryMapPtr * = UNTRACED POINTER TO CardMemoryMap;
  23.   TPAmigaXIPPtr    * = UNTRACED POINTER TO TPAmigaXIP;
  24.  
  25. (* Structures used by the card.resource                         *)
  26.  
  27.   CardHandle * = STRUCT
  28.     node     * : e.Node;
  29.     removed  * : e.InterruptPtr;
  30.     inserted * : e.InterruptPtr;
  31.     status   * : e.InterruptPtr;
  32.     flags    * : SHORTSET;
  33.   END;
  34.  
  35.   DeviceTData * = STRUCT
  36.     size   * : LONGINT;    (* Size in bytes        *)
  37.     speed  * : LONGINT;    (* Speed in nanoseconds *)
  38.     type   * : SHORTINT;   (* Type of card         *)
  39.     flags  * : SHORTSET;   (* Other flags          *)
  40.   END;
  41.  
  42.   CardMemoryMap * = STRUCT
  43.     commonMemory    * : e.APTR;
  44.     attributeMemory * : e.APTR;
  45.     ioMemory        * : e.APTR;
  46.  
  47. (* Extended for V39 - These are the size of the memory spaces above *)
  48.  
  49.     commonMemSize    * : LONGINT;
  50.     attributeMemSize * : LONGINT;
  51.     ioMemSize        * : LONGINT;
  52.   END;
  53.  
  54. CONST
  55. (* CardHandle.cah_CardFlags for OwnCard() function              *)
  56.  
  57.   resetRemove    * = 0;
  58.   ifAvailable    * = 1;
  59.   delayOwnerShip * = 2;
  60.   postStatus     * = 3;
  61.  
  62. (* ReleaseCreditCard() function flags                           *)
  63.  
  64.   removeHandle   * = 0;
  65.  
  66. (* ReadStatus() return flags                                    *)
  67.  
  68.   statusbCCDET   * = 6;
  69.   statusbBVD1    * = 5;
  70.   statusbSC      * = 5;
  71.   statusbBVD2    * = 4;
  72.   statusbDA      * = 4;
  73.   statusbWR      * = 3;
  74.   statusbBSY     * = 2;
  75.   statusbIRQ     * = 2;
  76.  
  77. (* CardProgramVoltage() defines *)
  78.  
  79.   voltage0v      * = 0;       (* Set to default; may be the same as 5V *)
  80.   voltage5v      * = 1;
  81.   voltage12v     * = 2;
  82.  
  83. (* CardMiscControl() defines *)
  84.  
  85.   enablebDigaudio * = 1;
  86.   disablebWp      * = 3;
  87.  
  88. (*
  89.  * New CardMiscControl() bits for V39 card.resource.  Use these bits to set,
  90.  * or clear status change interrupts for BVD1/SC, BVD2/DA, and BSY/IRQ.
  91.  * Write-enable/protect change interrupts are always enabled.  The defaults
  92.  * are unchanged (BVD1/SC is enabled, BVD2/DA is disabled, and BSY/IRQ is enabled).
  93.  *
  94.  * IMPORTANT -- Only set these bits for V39 card.resource or greater (check
  95.  * resource base VERSION)
  96.  *
  97.  *)
  98.  
  99.   intbSetClr * = 7;
  100.   intbBVD1   * = 5;
  101.   intbSC     * = 5;
  102.   intbBVD2   * = 4;
  103.   intbDA     * = 4;
  104.   intbBSY    * = 2;
  105.   intbIRQ    * = 2;
  106.  
  107. (* CardInterface() defines *)
  108.  
  109.   interfaceAmiga0 * = 0;
  110.  
  111. (*
  112.  * Tuple for Amiga execute-in-place software (e.g., games, or other
  113.  * such software which wants to use execute-in-place software stored
  114.  * on a credit-card, such as a ROM card).
  115.  *
  116.  * See documentatin for IfAmigaXIP().
  117.  *)
  118.  
  119.   cisTplAmigaXIP * = 091H;
  120.  
  121. TYPE
  122.   TPAmigaXIP * = STRUCT
  123.     code   * : SHORTINT;
  124.     link   * : SHORTINT;
  125.     loc    * : ARRAY 4 OF SHORTINT;
  126.     flags  * : SHORTSET;
  127.     resrv  * : SHORTINT;
  128.   END;
  129.  
  130. CONST
  131. (*
  132.  * The XIPFLAGB_AUTORUN bit means that you want the machine
  133.  * to perform a reset if the execute-in-place card is inserted
  134.  * after DOS has been started.  The machine will then reset,
  135.  * and execute your execute-in-place code the next time around.
  136.  *
  137.  * NOTE -- this flag may be ignored on some machines, in which
  138.  * case the user will have to manually reset the machine in the
  139.  * usual way.
  140.  *
  141.  *)
  142.  
  143.   autoRun        * = 0;
  144.  
  145. VAR
  146. (*
  147.  *  You have to put a pointer to the card.resource here to use the cia
  148.  *  procedures:
  149.  *)
  150.   base * : e.APTR;
  151.  
  152. PROCEDURE OwnCard         *{base,-006H}(handle{9}     : CardHandlePtr): CardHandlePtr;
  153. PROCEDURE ReleaseCard     *{base,-00CH}(handle{9}     : CardHandlePtr;
  154.                                         flags{0}      : LONGINT);
  155. PROCEDURE GetCardMap      *{base,-012H}(): CardMemoryMapPtr;
  156. PROCEDURE BeginCardAccess *{base,-018H}(handle{9}     : CardHandlePtr): BOOLEAN;
  157. PROCEDURE EndCardAccess   *{base,-01EH}(handle{9}     : CardHandlePtr): BOOLEAN;
  158. PROCEDURE ReadCardStatus  *{base,-024H}(): SHORTINT;
  159. PROCEDURE CardResetRemove *{base,-02AH}(handle{9}     : CardHandlePtr;
  160.                                         flag{0}       : LONGINT): BOOLEAN;
  161. PROCEDURE CardMiscControl *{base,-030H}(handle{9}     : CardHandlePtr;
  162.                                         controlBits{1}: SHORTSET ): SHORTSET;
  163. PROCEDURE CardAccessSpeed *{base,-036H}(handle{9}     : CardHandlePtr;
  164.                                         nanoseconds{0}: LONGINT): LONGINT;
  165. PROCEDURE CardProgramVoltage*{base,-03CH}(handle{9}   : CardHandlePtr;
  166.                                           voltage{0}  : LONGINT): LONGINT;
  167. PROCEDURE CardResetCard   *{base,-042H}(handle{9}     : CardHandlePtr): BOOLEAN;
  168. PROCEDURE CopyTuple       *{base,-048H}(handle{9}     : CardHandlePtr;
  169.                                         buffer{8}     : ARRAY OF SYSTEM.BYTE;
  170.                                         tupleCode{1}  : LONGINT;
  171.                                         size{0}       : LONGINT): BOOLEAN;
  172. PROCEDURE DeviceTuple     *{base,-04EH}(tupleData{8}  : e.APTR;
  173.                                         storage{9}    : DeviceTDataPtr): LONGINT;
  174. PROCEDURE IfAmigaXIP      *{base,-054H}(handle{10}    : CardHandlePtr): e.ResidentPtr;
  175. PROCEDURE CardForceChange *{base,-05AH}(): BOOLEAN;
  176. PROCEDURE CardChangeCount *{base,-060H}(): LONGINT;
  177. PROCEDURE CardInterface   *{base,-066H}(): LONGINT;
  178.  
  179. END CardRes.
  180.  
  181.